<?php
header ( "Content-type: text/html; charset=utf-8" ); //设置文件编码格式
	session_start();//启动Session
	include "../conn/conn.php";//包含数据库连接文件
	$manager=$_POST['manager'];
	$pwd=$_POST['pwd'];
	$a_sqlstr = "select * from tb_manager where name= '".$manager."' and password='".$pwd."'";//定义查询语句
	$result = mysqli_query($link,$a_sqlstr);
		if(mysqli_num_rows($result)>0){//将查询结果返回到数组并判断结果是否为真
		$a_rst=mysqli_fetch_assoc($result);
		if($a_rst[whether] == "0"){//如果第7个字段值为0
			echo "<script>alert('您所登录的用户被冻结，如果有疑问请拨打电话***咨询详细信息');history.go(-1)</script>";//弹出对话框
			exit();//退出程序
		}
		$_SESSION['admin']=$a_rst[name];//为Session变量赋值
		$_SESSION['type']=$a_rst[type];//为Session变量赋值
		$_SESSION['m_id']=$a_rst[id];//为Session变量赋值
		echo "<script>alert('登录成功');location='main.php';</script>";//弹出对话框
	}
	else{
		echo "<script>alert('用户名或密码输入错误');history.go(-1);</script>";//弹出对话框
	}
?>